Skip to content

generate CVMFS filebundle prefetch files - #111

Merged
pbuncic merged 10 commits into
mainfrom
feature/cvmfs-filebundle-prefetch
Aug 27, 2026
Merged

generate CVMFS filebundle prefetch files#111
pbuncic merged 10 commits into
mainfrom
feature/cvmfs-filebundle-prefetch

Conversation

@pbuncic

@pbuncic pbuncic commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Adds bits preload, a post-publish tool that generates CVMFS filebundle prefetch
files (.cvmfsbundle-<exe>, per the CVMFS spec) for already-deployed packages.
For each package test it straces the deployed binary on the tree, turns the
opened /cvmfs files into a spec-conformant bundle next to the trigger, and tars
them. Opening the trigger then prefetches its whole dependency closure in one
round trip instead of many.

It runs after publish, over the deployed tree — so it needs no rebuild and
works on software published long ago. Because the binaries are already at their
final /cvmfs paths, dependency paths are exact (a mount-strip), with no
relocation and no cross-package resolution.

What's included

  • bits preload — config-driven sweep over arch × package × version × test.
    Idempotent (skips a version whose .cvmfsbundle-<exe> exists, --update to
    regenerate), discovers arches/versions from the tree (reusing cvmfs_inspect),
    traces natively or in a container (--docker).
  • Test source, two ways: a recipe's preload: section (hash-excluded — see
    below), or a fully self-contained preload.yaml (cvmfs + arch + packages
    • tests) for users who don't use bits recipes.
  • preload is hash-excluded (_HASH_EXCLUDED_META_KEYS): recipes can carry
    their tests with no rebuild.
  • bits cvmfs-publish --tar FILE… — publishes the bundle tar(s) as a
    root-overlay through the existing prepub stage_tar/submit_staged path.

Usage

# recipe-driven or standalone config
bits preload --config preload.yaml [--docker --docker-image IMG] --output bundles.tar
bits cvmfs-publish --tar bundles.tar --repo <repo> --prepub-url <url> [--stratum0-url <url>]
# preload.yaml (self-contained example)
cvmfs: /cvmfs/<repo>/lcg/bits
arch: [x86_64-el9-gcc14-opt]          # omit to discover all deployed platforms
packages:
  - xrootd:                           # tests here; a bare name defers to the recipe preload:
      tests:
        - { exe: bin/xrdcp, args: [--version] }

pbuncic added 10 commits August 26, 2026 11:33
New bits_helpers/preload_bundle.py turns a package's .bits-preload/*.paths
sidecars into spec-conformant .cvmfsbundle-<trigger> JSON: resolves each
opened file to its owning package's CVMFS path, lists repo-root-absolute
deps (trigger excluded), removes the sidecar dir. Pure + unit-tested; not
yet wired into publish.
Regenerate .cvmfsbundle specs from a trigger straced on an already-deployed
CVMFS tree: opens are already /cvmfs-absolute, so repo-root is a mount strip
(no relocation, no cross-package map). Pure + unit-tested; drives the coming
'bits preload' tool.
… parse, tar)

Pure, unit-tested steps for the post-publish tool: detect/extract a recipe's
Preload() triggers by parsing cvmfs_preload calls (no recipe sourcing), locate
a package under a deployed CVMFS path, parse strace open/openat output, and
assemble staged .cvmfsbundle-* files into one tar. Orchestration + wiring next.
parse_strace_opens keeps only successful opens (ret >= 0), dropping the
loader's ENOENT probes in tls/, glibc-hwcaps/ and arch subdirs; to_repo_absolute
normpath's the path so the BITS_ARCH_PREFIX="." '/./' does not leak into deps.
Add 'preload' to _HASH_EXCLUDED_META_KEYS so a recipe can carry its CVMFS
filebundle test list (consumed post-publish by 'bits preload') without editing
it forcing a rebuild.
…ry helpers

Read tests from a recipe preload: section (replaces the Preload() bash parser);
load config/preload.yaml (arch scalar/list or discover; packages bare/mapping
with test overrides); resolve config-over-recipe; bundle_exists skip check;
discover_archs / package_versions / package_dir via cvmfs_inspect.
Config-driven sweep over arch x package x version x test: strace each recipe
test (native or --docker), build .cvmfsbundle-* specs, one tar. Idempotent
(skip existing unless --update), arch discovery, injectable tracer for tests.
Wire 'bits preload' in the wrapper. --publish deferred to the prepub --tar path.
…repub

publish_overlay_tars stages each tar at path='' (files land at their repo-
relative locations, e.g. bits preload .cvmfsbundle-*) through the existing
stage_tar/submit_staged path; distinct job_id_base per tar; caller's tar kept.
'bits preload' prints the ready-to-run 'bits cvmfs-publish --tar' command.
…ndependent)

Add a cvmfs: key to preload.yaml and make --cvmfs optional (CLI overrides
config, error if neither). With per-package tests: in the config no recipe is
consulted, so 'bits preload --config preload.yaml' works with no bits recipes.
The wrapper pre-parses a global --config (bits.rc) that swallowed 'bits preload
--config <yaml>', leaving the value as a stray positional. Handle 'preload' from
raw ARGV before that loop so its own --config reaches preload_cmd.
@pbuncic
pbuncic merged commit 4f79f55 into main Aug 27, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant